CREATE TABLE [dbo].[COTIZACIONES]
(
[ID] [numeric] (10, 0) NOT NULL,
[ID_CLIENTE] [numeric] (10, 0) NOT NULL,
[ID_VENDEDOR] [numeric] (10, 0) NOT NULL,
[ID_USUARIO] [numeric] (10, 0) NOT NULL,
[ID_FACTURA] [numeric] (10, 0) NULL,
[FECHA] [datetime2] (0) NOT NULL CONSTRAINT [DF_COTIZACIONES_FECHA] DEFAULT (getdate()),
[ACTIVO] [bit] NOT NULL CONSTRAINT [DF_COTIZACIONES_ACTIVO] DEFAULT ((1)),
[OBSERVACIONES] [varchar] (300) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[T_IMPUESTO] [numeric] (10, 2) NOT NULL,
[T_DESCUENTO] [numeric] (10, 2) NOT NULL,
[M_TOTAL] [numeric] (10, 2) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[COTIZACIONES] ADD CONSTRAINT [PK_COTIZACIONES] PRIMARY KEY CLUSTERED  ([ID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[COTIZACIONES] ADD CONSTRAINT [FK_COTIZACIONES_CLIENTES] FOREIGN KEY ([ID_CLIENTE]) REFERENCES [dbo].[CLIENTES] ([ID])
GO
ALTER TABLE [dbo].[COTIZACIONES] ADD CONSTRAINT [FK_COTIZACIONES_FACTURAS] FOREIGN KEY ([ID_FACTURA]) REFERENCES [dbo].[FACTURAS] ([ID])
GO
ALTER TABLE [dbo].[COTIZACIONES] ADD CONSTRAINT [FK_COTIZACIONES_USUARIOS] FOREIGN KEY ([ID_USUARIO]) REFERENCES [dbo].[USUARIOS] ([ID])
GO
ALTER TABLE [dbo].[COTIZACIONES] ADD CONSTRAINT [FK_COTIZACIONES_VENDEDORES] FOREIGN KEY ([ID_VENDEDOR]) REFERENCES [dbo].[VENDEDORES] ([ID])
GO
